<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>调拔单列表</title>
<script language="javascript">
	function showConifrmForm(dataid){
		$.get("/sales/ajaxbutton?op=storeConfirmForm",{"dataid":dataid},function(data){
			$("#endorderlistst").html(data);
			$('#endorderform').modal('show');
			///sales/ajaxbutton?op=updateStock&needid=	
		})
	}
</script>
</head>

<body>
<div class="centercontent tables">
    <div class="pageheader notab">
        <h1 class="pagetitle">调拔单列表</h1>
        <span class="pagedesc"></span>
    </div>
</div>
<div class="contentwrapper">
<form class="stdform stdform2" method="post" action="/sales/saveNeedStore">
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
                <thead>
                <tr>
                  <th class="head1">&nbsp;</th>
                    <th class="head1">id</th>
                    <th class="head1">调货单标题</th>
                  <th class="head1">创建者</th>
                  <th class="head1">创建时间</th>
                  <th class="head1">执行状态</th>
                  <th class="head1">操作</th>
                </tr>
                </thead>
                <tbody>
                {{foreach from=$datalist item=li key=key}}
                <tr>
                  <td><input name="storeid[]" type="checkbox" value="{{$li.id}}"></td>
                    <td>{{$li.id}}
                      <input type='hidden' name='good_sku[{{$li.id}}]' value="{{$li.goods_sku}}"></td>
                    <td><a href="/sales/ajaxbutton?op=storeNeedDetail&needid={{$li.id}}" target="_blank">{{$li.createtime|substr:0:16}}调货单</a></td>
                    <td>{{$li.creator}}</td>
                    <td>{{$li.createtime|substr:5:14}}</td>
                  <td>{{if $li.action_state==1}}调拔完成{{else}}未完成{{/if}}</td>
                  <td><a href="/sales/ajaxbutton?op=storeNeedDetail&needid={{$li.id}}" target="_blank">打印调货单</a> {{if $li.action_state < 1}}<a href="javascript:;" onclick="showConifrmForm({{$li.id}})">标志完成</a><!--，标志完成将会把调拔的数量从2号仓更新到1号仓!-->  &nbsp;<a href="/sales/ajaxbutton?op=delStroeNeed&needid={{$li.id}}" onclick="return confirm('确定删除吗?');">删除</a>{{else}}<a href="javascript:;" onclick="showConifrmForm({{$li.id}})">调货结果</a>{{/if}}</td>
      </tr>
                {{/foreach}}    
                </tbody>
            </table>
  </form>
            <div class="page">{{$pageList}} 计{{$total}}条记录</div>
</div>

<!-- 模态框（Modal）批量标完成 -->
<form action="/sales/ajaxbutton?op=updateStock"  method="post" name="batchendorderST" id="batchendorderST">
  <div class="modal fade" id="endorderform" tabindex="-1" role="dialog" aria-labelledby="sendorderform" aria-hidden="true">
    <div class="modal-dialog" style="width:840px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sendorderform"> 确认真实调货数量</h4>
        </div>
        <div class="modal-body">
         <span id="errshow"></span>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
          
          <div style="width:100%;height:300px;overflow:auto; border:0px solid;">
           <span id="endorderlistst">
           </span>
           <span id="fileinput"></span>
          </div>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  </form>
</body>
</html>
